<?php

class CompositeMecanique extends Composite
{
	private $type;
	private $nom;	
	public function __construct($type, $nom, $elts=array()) {
		$this->nom=$nom;
		$this->type=$type;
		Composite::__construct($elts);
	}
	
	public function getType(){
		return $this->type;
	}
	
	public function getNom(){
		return $this->nom;
	}
	
	public function toString($esp=0) {
		for ($i=0;$i<$esp;$i++) $ret.="\t";
		$ret.=__CLASS__ . "( " . $this->type . " : " . $this->nom . " )";
		$ret.="\n";
		$elts=$this->getElements();
		foreach ($elts as $elt) {
			$ret.=$elt->toString($esp+1);
		}
		return $ret;
	}
}
?>
